
/**
 * Created by YanXu on 2016/9/29.
 */

'use strict';

ImporInfor()
//获取订单编号
var orderNo = getQueryString("orderNo");

var urlgetmyProvideOrderDetail="/order/get/myProvideOrderDetail";

//填充数据
fillData(orderNo,urlgetmyProvideOrderDetail);

//填充数据函数
function fillData(orderNo,url){
    if(orderNo==null|| orderNo.toString().length<1){
        return;
    }
    var parm = "orderNo="+orderNo +"&" + Infornation;

    $.ajax({
        url:host+url,
        type : "post",
        data:parm,
        success:function(res){
            if(res.success == true){
            	var str = '';
                if(res.data.length<1){
                    return;
                }
                
                
                $("#content .modular .order-no").html(res.data[0].orderNo);
                $("#content .purchasing-info .content .meat-category").html(res.data[0].meatCategory.join(","));
                $("#content .purchasing-info .content .provide-desc").html(res.data[0].provideDesc);
                $("#content .purchasing-info .content .amount").html(Math.round(res.data[0].amount/1000*100)/100);
                
                $("#content .purchasing-info .content .unit").html('吨');
                $("#content .purchasing-info .content .price").html((res.data[0]['price'] == '' ? strNew : res.data[0]['price']));
                $("#content .purchasing-info .content .country").html(res.data[0].country);
                $("#content .purchasing-info .content .warehouse").html(res.data[0].warehouse);

                $("#content .purchasing-info .content .provide-way").html(res.data[0].provideWay);
                $("#content .modular  .purchase-user").html(res.data[0].purchaseUser);
                $("#content .content .update").html(res.data[0].updateDate);
                
                //订单状态
                var orderstatus =  res.data[0].status;
                if(orderstatus==2){
                    $("#content .modular  .order-status").html("交易中");
                }else if(orderstatus==3){
                    $("#content .modular  .order-status").html("交易成功");
                }else if(orderstatus==4){
                    $("#content .modular  .order-status").html("交易失败");
                }
                $("#content .modular  .update-date").html(res.data[0].updateDate);
            }else{}
        },
        error:function () {}
    });

}

